<template>
  <div>
    <!-- 欢迎区域 -->
    <div class="welcome-section">
      <h1>乡村文化遗产数字化保护平台</h1>
      <p>致力于保护和传承中国乡村文化遗产，让传统文化在数字时代焕发新生</p>
    </div>

    <!-- 图片展示区域 -->
    <div class="image-showcase">
      <img src="/images/1.jpeg" class="showcase-image">
    </div>

    <!-- 平台介绍 -->
    <div class="section">
      <div class="content">
        <h2 class="title">关于我们的平台</h2>
        <p class="info-text">
          乡村文化遗产数字化保护平台是一个致力于保护和传承中国乡村文化遗产的综合性平台。
          我们运用现代化的数字技术，对乡村文化遗产进行全方位的记录、保护和展示，
          让珍贵的文化遗产能够被更好地保存和传承。
        </p>
        <p class="info-text">
          通过数字化手段，我们不仅保护了物质文化遗产，
          更记录了非物质文化遗产中的技艺、习俗、传说等内容，
          让这些宝贵的文化财富能够永续传承。
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  mounted() {
    this.initImageCarousel()
  },
  methods: {
    initImageCarousel() {
      const images = document.querySelectorAll('.showcase-image')
      const dots = document.querySelectorAll('.showcase-dot')

      function showImage(index) {
        images.forEach(img => img.classList.remove('active'))
        dots.forEach(dot => dot.classList.remove('active'))
        
        images[index].classList.add('active')
        dots[index].classList.add('active')
      }

      dots.forEach((dot, index) => {
        dot.addEventListener('click', () => {
          showImage(index)
        })
      })
    }
  }
}
</script>

<style scoped>
.welcome-section {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), 
    url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1600&h=900');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 150px 0;
  margin: -1rem -1rem 2rem -1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.welcome-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.8; }
  100% { opacity: 0.6; }
}

.welcome-section h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  display: inline-block;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 20px rgba(255,255,255,0.5); }
  to { text-shadow: 0 0 30px rgba(255,255,255,0.8); }
}

.welcome-section p {
  font-size: 1.4rem;
  max-width: 800px;
  margin: 0 auto;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.8;
  opacity: 0.9;
  position: relative;
}

.image-showcase {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 2rem auto;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.98);
}

.showcase-image {
  flex: 1;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.showcase-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.showcase-image.active {
  opacity: 1;
  transform: scale(1.05);
}

.showcase-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 2;
}

.showcase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.showcase-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.showcase-dot.active {
  background: white;
  transform: scale(1.2);
  border-color: rgba(255, 255, 255, 0.8);
}

.section {
  padding: 4rem 2rem;
}

.content {
  max-width: 1000px;
  margin: 0 auto;
}

.title {
  font-size: 2.5rem;
  color: #1a202c;
  margin-bottom: 2rem;
  text-align: center;
}

.info-text {
  color: #4a5568;
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  text-align: justify;
}

.info-text:last-child {
  margin-bottom: 0;
}
</style> 